package com.kede.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 物资表
 * @TableName t_supplies
 */
@TableName(value ="t_supplies")
@Data
public class SuppliesDomain implements Serializable {
    /**
     * 
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 物资名称
     */
    @TableField(value = "supplie_name")
    private String supplieName;

    /**
     * 数量
     */
    @TableField(value = "num")
    private Integer num;

    /**
     * 交付图片信息
     */
    @TableField(value = "delivery_img")
    private String deliveryImg;

    /**
     * 渠道
     */
    @TableField(value = "channel")
    private String channel;

    /**
     * 展示图片，给用户看的
     */
    @TableField(value = "show_img")
    private String showImg;

    /**
     * 
     */
    @TableField(value = "create_by")
    private String createBy;

    /**
     * 
     */
    @TableField(value = "update_by")
    private String updateBy;

    /**
     * 
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 剩余多少
     */
    @TableField(value = "curr_num")
    private Integer currNum;

    /**
     * 需要多少德币
     */
    @TableField(value = "debi")
    private BigDecimal debi;

    /**
     * 需要多少RMB
     */
    @TableField(value = "money")
    private BigDecimal money;

    /**
     * 每个人购买数量限制
     */
    @TableField(value = "buy_num")
    private Integer buyNum;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        SuppliesDomain other = (SuppliesDomain) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSupplieName() == null ? other.getSupplieName() == null : this.getSupplieName().equals(other.getSupplieName()))
            && (this.getNum() == null ? other.getNum() == null : this.getNum().equals(other.getNum()))
            && (this.getDeliveryImg() == null ? other.getDeliveryImg() == null : this.getDeliveryImg().equals(other.getDeliveryImg()))
            && (this.getChannel() == null ? other.getChannel() == null : this.getChannel().equals(other.getChannel()))
            && (this.getShowImg() == null ? other.getShowImg() == null : this.getShowImg().equals(other.getShowImg()))
            && (this.getCreateBy() == null ? other.getCreateBy() == null : this.getCreateBy().equals(other.getCreateBy()))
            && (this.getUpdateBy() == null ? other.getUpdateBy() == null : this.getUpdateBy().equals(other.getUpdateBy()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCurrNum() == null ? other.getCurrNum() == null : this.getCurrNum().equals(other.getCurrNum()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSupplieName() == null) ? 0 : getSupplieName().hashCode());
        result = prime * result + ((getNum() == null) ? 0 : getNum().hashCode());
        result = prime * result + ((getDeliveryImg() == null) ? 0 : getDeliveryImg().hashCode());
        result = prime * result + ((getChannel() == null) ? 0 : getChannel().hashCode());
        result = prime * result + ((getShowImg() == null) ? 0 : getShowImg().hashCode());
        result = prime * result + ((getCreateBy() == null) ? 0 : getCreateBy().hashCode());
        result = prime * result + ((getUpdateBy() == null) ? 0 : getUpdateBy().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCurrNum() == null) ? 0 : getCurrNum().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", supplieName=").append(supplieName);
        sb.append(", num=").append(num);
        sb.append(", deliveryImg=").append(deliveryImg);
        sb.append(", channel=").append(channel);
        sb.append(", showImg=").append(showImg);
        sb.append(", createBy=").append(createBy);
        sb.append(", updateBy=").append(updateBy);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", currNum=").append(currNum);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}